<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="/WEB-INF/lang-support.tld" prefix="lang-support"%>  
<%@ page import="nc.vo.sm.UserVO"%>
<%@ page import="nc.vo.ebvp.logindex.pojo.Constant"%>
<%@ page import="nc.bs.ebvp.sourcingcoll.Constants"%>
<%@ page import="nc.bs.ebvppub.ebvpservicefactory.LoadConfigProperty"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
	if(basePath.endsWith("/")){
		basePath = basePath.substring(0,basePath.length()-1);
	}
	String strProjPk = request.getParameter("pkProj");
	String strParaEc021 = (String)request.getSession().getAttribute(Constants.ID_EC021);
	String strParaEc022 = (String)request.getSession().getAttribute(Constants.ID_EC022);
	UserVO userVo = (UserVO)request.getSession().getAttribute(Constant.USER_INFO);
	boolean isClientCa = false;
	boolean isServerCa = false;
	//供应商客户端是否支持CA
	if("Y".equalsIgnoreCase(strParaEc021) || (null != userVo.getIsca() && userVo.getIsca().booleanValue())){
		isClientCa = true;
	}
	//招投标服务器是否支持CA
	if("Y".equalsIgnoreCase(strParaEc022)){
		isServerCa = true;
	}
	//CA厂商名称
	String strCaFactory = (String)request.getSession().getAttribute(LoadConfigProperty.EBVP_CA_FACTORY);
%>

<html>
	<head>
		<script type="text/javascript">
			var strProjStepPk="${REPLY_FORM.pk_purproj_step}";
			var ebvpContext = "<%=basePath%>";
			var isClientCa = "<%=isClientCa%>";
			var exeStatus = "<%=request.getAttribute("exeStatus")%>";
			var handleResult = "${REPLY_FORM.handleResult}";
			var pk_release_h = "${RELEASE_FORM.pk_release_h}";
			var msg = "${msg}";
			var strSelLan = "${sel_lan}";
			var strParaEc021 = "<%=strParaEc021%>";
			var strParaEc022 = "<%=strParaEc022%>";
		</script>
		<link rel="stylesheet" type="text/css" href="commonres/common/frame/src/css/bid.css" />
		<script type="text/javascript" src="commonres/common/frame/src/js/bid_invited.js"></script>
		<script type="text/javascript" src="<%=path%>/commonres/common/frame/src/js/bid_flow.js"></script>
		<script type="text/javascript"
			src="<%=path%>/commonres/common/drop_dialog/src/js/UI.DropDialog.js"></script>
		<script type="text/javascript"
			src="<%=path%>/commonres/common/drop_dialog/src/js/UI.DropDialog_bank.js"></script>
		<script type="text/javascript"
			src="<%=path%>/commonres/base/common.js"></script>
		
		<%if(isClientCa||isServerCa){%>
		<%if(Constants.CA_FACTORY_ITRUS.equals(strCaFactory)){%>
		<script type="text/javascript" src="js/itrusforNC.js"></script>
		<script type="text/javascript" src="js/pta.js"></script>
		<%} else if(Constants.CA_FACTORY_INFOSEC.equals(strCaFactory)){%>
		<script type="text/javascript" src="js/Infosec4NC.js"></script>
		<%} else if(Constants.CA_FACTORY_DEAN.equals(strCaFactory)){%>
		<script type="text/javascript" src="js/DatechJs.js"></script>
		<%} %>
		<%}%>
		<lang-support:langres resid="ec22400_0;ec22210_0" />
	</head>
	<body>
		<form action="" method="post" name="replyform">
			<input type="hidden" id="finaltime"  name="finaltime" value="${DISMILL}"/>
			<input type="hidden" name="pk_file" />
			<input type="hidden" name="file_name" />
			<input type="hidden" name="casn" value=""/>
			<input type="hidden" name="signature" value=""/>
			<!-- Document Content -->
			<div class="float_center doc_width">
				<div class="doc_content_shadow">
					<div class="doc_content">
						<div id="bidFlowMore" class="bid_flow"></div>
						<div class="bid_content invited">
							<div class="bid_invited ft_yahei">
								<div id="projName" style="margin-left:15px;margin-top:20px;font-size:19px;color:white">${REPLY_FORM.projInfo}</div>
								<div id="countdownTimer" class="bid_module pd_10x5px"></div>
							</div>
							<div class="bid_invited_content">
								<strong resid="0ec22210-000001" class="float_left w_100ps">邀请函内容：</strong>
								<span class="float_left w_100ps align_justify">
									<div style="width:650px; word-wrap:break-word; word-spacing:normal;white-space:pre-wrap;">${RELEASE_FORM.releasetxt}</div>
								</span>
							</div>
							
							<div resid="0ec22210-000002" class="bid_invited_content_title">
								邀请文件
							</div>
							<div class="bid_content_inner pd_5x0px">
								<c:if test="${RELEASE_FILE_FORM != null}">
									<c:forEach items="${RELEASE_FILE_FORM}" var="file">
										<div class="bid_invited_file_list <c:if test="${file.index > 1}">bdtop_dashed</c:if>">
											<div class="float_left w_690px">
												<span>${file.index}、</span>
												<a href="javascript:downloadFile('${file.pk_file}','${file.file_name}');" style="text-decoration:none"><span class="color_0062b0">${file.file_name}</span></a>
												<span>(${file.file_size}KB) </span>[
												<a resid="0ec22210-000003" href="javascript:downloadFile('${file.pk_file}','${file.file_name}');">下载</a>]
												<% if (isServerCa) {%>
													<!-- 20180529
													<a class="btn_blue" id="onCheckFile" name="onCheckFile" href="javascript:verifyFile('${file.signature}','${file.index}');;" style="margin-left:3px;float:right"><span resid="0ec22210-000083" class="w_34px h_18px ft_14px">验签</span></a>
													-->
													<!-- 20180611
													<input name="fileName" type="file" style="float:right" size="10" />
													-->
												<% } %>
												<span class="bid_invited_file_note">${file.file_note}</span>
											</div>
										</div>
									</c:forEach>
								</c:if>
							</div>
							
							<div resid="0ec22210-000004" class="bid_invited_content_title">
								应答文件
							</div>
							<div class="bid_content_inner">
								<div class="float_center w_120px">
									<a href="javascript:uploadFile();" id="upload"
										class="btn_blue mrg_top10px"> <span resid="0ec22210-000005" class="w_110px h_18px">上传应答文件</span>
									</a>
								</div>
							</div>

							<div resid="0ec22210-000006" class="bid_invited_content_title">应答文件列表</div>
							<div class="subpage_table" style="width:728px;margin-top:0px;padding:0px">
								<table id="bidFileTable" cellpadding="0" cellspacing="0" style="width:728px">
									<thead>
									<tr>
										<td resid="0ec22210-000007" width="40px">序号</td>
										<td resid="0ec22210-000008" width="300px">文件</td>
										<td resid="0ec22210-000009" width="70px">大小</td>
										<td resid="0ec22210-000010" width="270px">备注</td>
										<td resid="0ec22210-000011" width="48px">删除</td>
									</tr>
									</thead>
									<c:if test="${REPLY_FILE_FORM != null}">
										<c:forEach items="${REPLY_FILE_FORM}" var="file">
											<tr id="${file.pk_file}" <c:if test="${file.index%2==0}">class="odd"</c:if>>
												<input type="hidden" id="reply_file_real_path" name="reply_file_real_path" value="${file.real_path}"/>
												<td >${file.index}</td>
												<td >${file.file_name}<input type="hidden" id="reply_file_name" name="reply_file_name" value="${file.file_name}" /></td>
												<td ><span id="fSize">${file.file_size}</span>KB<input type="hidden" id="reply_file_size" name="reply_file_size" value="${file.file_size}" /></td>
												<td >${file.file_note}<input type="hidden" id="reply_file_memo" name="reply_file_memo" value="${file.file_note}" />&nbsp;</td>
												<td>
													<a class="btn_orange" id="onDelete" name="onDelete" href="javascript:delFile('${file.pk_file}');" style="margin-left:3px"><span resid="0ec22210-000012" class="w_34px h_18px ft_14px">删除</span></a>
												</td>
											</tr>
										</c:forEach>
									</c:if>
								</table>
							</div>
							
							<div resid="0ec22210-000013" class="bid_invited_content_title">
								应答信息
							</div>
							<div id="bidInvitedForm" class="bid_content_inner pd_10x0px">
								<div class="form_row">
									<div resid="0ec22210-000014" class="form_title w_80px">
										参加
									</div>
									<div class="form_field w_485px">
										<label>
											<input type="checkbox" name="is_join" id="is_join" value="Y"
												<c:if test="${REPLY_FORM.is_join != null && REPLY_FORM.is_join == \"Y\"}">checked</c:if>
											/>
										</label>
									</div>
								</div>
								<div class="form_row">
									<div resid="0ec22210-000015" class="form_title w_80px">
										代理
									</div>
									<div class="form_field w_485px">
										<label>
											<input type="checkbox" name="is_agent" id="is_agent" value="Y"
												<c:if test="${REPLY_FORM.is_agent != null && REPLY_FORM.is_agent == \"Y\"}">checked</c:if>
												onclick="setAgentSupplier()" />
										</label>
									</div>
								</div>
								<div class="form_row">
									<div resid="0ec22210-000016" class="form_title w_80px">
										代理商名称
									</div>
									<div class="form_field w_485px">
										<label>
											<input type='text' class="textfield pd_5x2px w_180px" id='agent_name' name='agent_name' size='16'
												value="<c:if test="${REPLY_FORM.agent_name != null}">${REPLY_FORM.agent_name}</c:if>"
												onfocus="select()" />
										</label>
									</div>
								</div>
								<div class="form_row">
									<div resid="0ec22210-000017" class="form_title w_80px">
										联系人
									</div>
									<div class="form_field">
										<label>
											<input type='text' class="textfield pd_5x2px w_180px" id='agent_person' name='agent_person' size='16'
												value="<c:if test="${REPLY_FORM.agent_person != null}">${REPLY_FORM.agent_person}</c:if>"
												onfocus="select()" />
										</label>
									</div>
								</div>
								<div class="form_row">
									<div resid="0ec22210-000018" class="form_title w_94px">
										联系电话
									</div>
									<div class="form_field">
										<label>
											<input type='text' class="textfield pd_5x2px w_180px" id='agent_phone' name='agent_phone' size='17'
												value="<c:if test="${REPLY_FORM.agent_phone != null}">${REPLY_FORM.agent_phone}</c:if>" />
										</label>
									</div>
								</div>
								<div class="form_row">
									<div resid="0ec22210-000019" class="form_title w_80px">
										手机号
									</div>
									<div class="form_field">
										<label>
											<input type='text' class="textfield pd_5x2px w_180px" id='agent_tel' name='agent_tel' size='30'
												value="<c:if test="${REPLY_FORM.agent_tel != null}">${REPLY_FORM.agent_tel}</c:if>"
												onfocus="select()" />
										</label>
									</div>
								</div>
								<div class="form_row">
									<div resid="0ec22210-000020" class="form_title w_94px">
										电子邮件
									</div>
									<div class="form_field">
										<label>
											<input type='text' class="textfield pd_5x2px w_180px" id='agent_mail' name='agent_mail' size='30'
												value="<c:if test="${REPLY_FORM.agent_mail != null}">${REPLY_FORM.agent_mail}</c:if>"
												onfocus="select()" />
										</label>
									</div>
								</div>
								<div class="form_row">
									<div resid="0ec22210-000021" class="form_title w_80px">
										承诺说明
									</div>
									<div class="form_field">
										<label>
											<textarea class="textfield pd_5x2px w_485px" rows="3" cols="50" id="promise" name="promise" onfocus="select()"><c:if test="${REPLY_FORM.promise != null}">${REPLY_FORM.promise}</c:if></textarea>
										</label>
									</div>
								</div>
								<div class="form_row">
									<div resid="0ec22210-000022" class="form_title w_80px">
										应答说明
									</div>
									<div class="form_field">
										<label>
											<textarea class="textfield pd_5x2px w_485px" rows="3" cols="50" id="reply_note" name="reply_note" onfocus="select()"><c:if test="${REPLY_FORM.reply_note != null}">${REPLY_FORM.reply_note}</c:if></textarea>
										</label>
									</div>
								</div>
							</div>
							
							<!--资格预审表-->
								<div class="prequal_table_name">资格预审表</div>
								<div id="prequal_table" class="prequal_bid_content">
									<c:forEach items="${PREQUAL_FORM}" var="prequal_form"  varStatus="s">
										<div class="prequal_bid_content_inner">
											<br><p><div class="prequalname_title">${s.index+1}、${prequal_form.prequalname}</div>
											<c:if test="${null != prequal_form.prequalcondi}">
												<p><div>(${prequal_form.prequalcondi})</div>
											</c:if>	
											<div>
												<label class="tipinside">
													<p>
													<textarea class="prequal_textarea" onfocus="select()"  name="textarea" id="textarea${s.index+1}">${prequal_form.supprepcond}</textarea>
													<input type='hidden' name="prequal_hidde_proje"  value="${prequal_form.pk_pur_proje}"> 
													<input type='hidden' name="prequal_hidde_step"  value="${prequal_form.pk_purpr_step}">
													<input type='hidden' name="prequal_hidde_suppreply"  value="${prequal_form.pk_suppreply}"> 
												</label>
											</div>	
											<input type='hidden' name="prequal_hidde" id='prequal_hidde${s.index+1}' value="${prequal_form.pk_prequal}"> 
											<div class="prequal_affix">
												<label>
												<c:if test="${null != prequal_form.prequalpromi && prequal_form.prequalpromi == 1}">
													<c:choose>
														<c:when test="${empty prequal_form.listPreSuppAffForm }" >
												   			<input type='hidden' class="prequal_affix_if" id='prequal_affix_if${prequal_form.pk_prequal}' value="0"> 
												   		</c:when>
												   		<c:otherwise>
												            <input type='hidden' class="prequal_affix_if" id='prequal_affix_if${prequal_form.pk_prequal}' value="1">      
												        </c:otherwise>
												   	</c:choose>
												   		<span><a class="doSuppAffixSavepre" href="javascript:doSuppAffixSave('${prequal_form.pk_prequal}');">上传附件</a></span><br>
												              <c:forEach items="${prequal_form.listPreSuppAffForm}" var="preSuppAffForm"  varStatus="s">
										    					   <td><span  class='deletePreSuppReply' id='deletePreSuppReply'><a href="javascript:downLoadSuppReply('${preSuppAffForm.prequalaffpk}','${preSuppAffForm.prequalaffname}');" title='${preSuppAffForm.prequalaffname}'>${preSuppAffForm.prequalaffmemo}</a><img class='imgRemoveName' onclick='deletePreSuppReply(this);' src='commonres/common/frame/src/img/deleteAffix.png'></img>
										    					    <input type='hidden' name="prequal_hidde_affaxPK" class='prequal_hidde_affaxPK' value="${preSuppAffForm.pk_preqaffix}"> 
										    					   </span></td>
											   				  </c:forEach>
												   	<!-- 附件信息（包括附件隐藏域）存放地方 -->
											   		<span class="${prequal_form.pk_prequal}"></span>
											   	</c:if>	
										   		</label>
										   	</div>
										</div>
									</c:forEach>
								</div>
								
							<!-- 
								<div class="prequal_table_div" style="margin-top:0px">
								<input type='hidden' class="textfield pd_5x2px w_180px" id='str' name='str' value="">
									<table>
									&nbsp;&nbsp;
									<c:forEach items="${PREQUAL_FORM}" var="prequal_form"  varStatus="s">
									  <tr>
									    <td width="300" rowspan="2">
									    <span style="color: #4F4F4F; float: left;font-weight: bold;">${s.index+1}、${prequal_form.prequalname}</span><br><br>
									    ${prequal_form.prequalcondi}
									    </td>
									    <td height="99" colspan="2">
									        <textarea name="textarea" id="textarea${s.index+1}" cols="45" rows="5">${prequal_form.supprepcond}</textarea>
									  	</td>
									  </tr>
									  <tr>
									    <td width="181" align="left">
									    	<c:if test="${prequal_form.prequalpromi == 1}">
									    		<input type='hidden' name="prequal_hidde" id='prequal_hidde${s.index+1}' value="${prequal_form.pk_prequal}"> 
										   		<span><a href="javascript:doSuppAffixSave('${prequal_form.pk_prequal}');">上传附件</a></span>
										   		<span class="${prequal_form.pk_prequal}"></span>
										   		<span id="${prequal_form.pk_prequal}"></span>
										    </c:if>
										   		<span><a href="javascript:doPrequalSave(${s.index+1});">保存</a></span>
									    </td>
									  </tr>
									</c:forEach>
									</table>
								</div>
							 -->
							 
							 
							<div class="bid_submit_btn">
								<a href="javascript:doReply();" id="bidSubmit"
									class="btn_orange"> <span resid="0ec22210-000023" class="w_80px h_25px ft_12px">提交</span>
								</a>
							</div>
							<div id="show_msg" style="color:red;float:left;height:31px;margin-top:17px;text-align:right;width:635px;">
							</div>
						</div>
						
						<div class="bid_column_right">
							<div class="sidebox">
								<div class="box_title bg_blue">
									<span class="title_icon noicon"></span>
									<span resid="0ec22210-000024" class="title_name">项目信息</span>
								</div>
								<div class="sidebox_bd bdbtm bdgray">
									<div class="bid_column_content h_142px">
										<strong>${PURPROJECT_FORM.project_name}</strong>
										<div class="float_left w_100ps">
											<span resid="0ec22210-000025">类型：</span><span>${PURPROJECT_FORM.sugg_pur_method}</span>
										</div>
										<div class="float_left w_100ps">
											<span resid="0ec22210-000026">发起时间：</span><span>${PURPROJECT_FORM.begin_exec_date}</span>
										</div>
										<div class="float_left w_100ps">
						                    <span resid="0ec22400-000109">币种：</span><span>${PURPROJECT_FORM.currency_name}</span>
						                </div>
									</div>
								</div>
							</div>
							<div class="sidebox">
						        <div class="box_title bg_blue">
						            <span class="title_icon noicon"></span>
						            <span resid="0ec22210-000027" class="title_name">当前步骤信息</span>
						        </div>
						        <div class="sidebox_bd bdbtm bdgray">
						            <div class="bid_column_content h_165px">
						                <div class="float_left w_100ps">
						                    <span resid="0ec22210-000028">提交人：</span><span>${REPLY_FORM.commit_psn_name}</span>
						                </div>
						                <div class="float_left w_100ps">
						                    <span resid="0ec22210-000029">提交时间：</span><span>${REPLY_FORM.commit_time}</span>
						                </div>
						            </div>
						        </div>
						    </div>
						</div>
					</div>
				</div>
			</div>
		</form>
<script language="javascript">

	

	//寻源环节导航栏
	$.ajax( {
		url : "<%=request.getContextPath()%>/sourcing/biddingprojlist/projexec?pk_pur_project=${PURPROJECT_FORM.pk_pur_project}&randomid="+new Date(),
		type : "GET",
		data : "",
		dataType : "text",
		async : false,
		success : function(responseText) {
		    		showSteps(responseText);
		  		}

	});
	//应答截止时间
	var overDate = ${DISMILL} * 1000;
    var NowTime = new Date();
    var EndTime= new Date(NowTime.getTime() + overDate); 

    $( "#countdownTimer" ).UICountdown({ 'endTime': EndTime, 'titleColor': "white", 'titleShadow': true, "titlePadding": "0 10px 0 3px" });

	if(toAccountSecond <= 0){
		disabledForm();
	}
	if(${DISMILL} <= 0){
		disabledForm();
	}
	window.afterReplyHandle();
	window.setAgentSupplier();
	window.afterReplyMsgShow();
</script>
	</body>
</html>